//
//  SICPSDKBlueToothTool.h
//  test1
//
//  Created by Piccolo on 2017/4/10.
//  Copyright © 2017年 Piccolo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "SICPSDKPeripheral.h"


#define READ_SERVICE @"0000FFF0-0000-1000-8000-00805F9B34FB"
#define READ_CHARA @"0000FFF4-0000-1000-8000-00805F9B34FB"
#define WRITE_SERVICE @"0000FFF0-0000-1000-8000-00805F9B34FB"
#define WRITE_CHARA @"0000FFF1-0000-1000-8000-00805F9B34FB"

//@protocol BlueToothToolDelegate <NSObject>
//@optional
//
//- (void)requestResultDic:(NSDictionary *)dic;
//- (void)scanedPeripheral:(CBPeripheral *)peripheral;
//- (void)currentRssi:(NSNumber *)rssi;

//@end


@interface SICPSDKBlueToothTool : NSObject<CBPeripheralManagerDelegate,CBCentralManagerDelegate,CBPeripheralDelegate>
//代理
//@property(nonatomic,weak)id<BlueToothToolDelegate>delegate;


@property (nonatomic, weak) CBCharacteristic *writeCharacteristic;
@property (nonatomic, weak) CBCharacteristic *readCharacteristic;
@property (atomic, strong) SICPSDKPeripheral *smartItPeripheral;
@property (atomic, strong) CBCentralManager *manager;

@property (nonatomic, strong) NSMutableDictionary *serviceBufferDic;
@property (nonatomic, strong) NSMutableArray *bleList;


//CBPeripheral *_peripheral;

/**
 *获取单例对象的方法
 */
+ (instancetype)sharedManager;

- (void)initBlueToothManager;
//进行写数据操作
- (void)destroyTheKey;


- (void)connectBle:(SICPSDKPeripheral *)ble;
- (void)disconnectBle;
- (void)startScan;
- (void)stopScan;
- (void)startDetectActiveReportingValueOfCharacteristic;

- (NSArray *)getValueOfCharacteristic;
- (NSMutableDictionary *)getValueServiceDic;
- (NSString *)getConnectedKey;
- (NSString *)getDisconnectedKey;

@end
